﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BestLifePOS_PresentationLayer
{
    public partial class frm_Main : Form
    {
        private int childFormNumber = 0;

        public frm_Main()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            Form childForm = new Form();
            childForm.MdiParent = this;
            childForm.Text = "Window " + childFormNumber++;
            childForm.Show();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //toolStrip.Visible = toolBarToolStripMenuItem.Checked;
        }

        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //statusStrip.Visible = statusBarToolStripMenuItem.Checked;
        }

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode node = treeView1.SelectedNode;
            if (node.Text == "Vendor List")
            {
                frmVendorList frmVList = new frmVendorList();
                frmVList.ShowDialog();
            }

            if (node.Text == "Vendor Bills")
            {
                frmVenderBills frmVVBills = new frmVenderBills();
                frmVVBills.ShowDialog();
            }

            if (node.Text == "Vendor Payment")
            {
                frmVenderPayment frmVPay = new frmVenderPayment();
                frmVPay.ShowDialog();
            }

            if (node.Text == "Purchease Order")
            {
                frmVPurcheaseOrder frmVPo = new frmVPurcheaseOrder();
                frmVPo.ShowDialog();
            }

            //if (node.Text == "Purchase Request")
            //{
            //    frmNewPR frmPR = new frmNewPR();
            //    frmPR.ShowDialog();
            //}

            if (node.Text == "Item")
            {
                frmItem frmItem = new frmItem();
                frmItem.ShowDialog();
            }

            if (node.Text == "Stock")
            {
                frmStock frmSt = new frmStock();
                frmSt.ShowDialog();
            }

            if (node.Text == "Categories")
            {
                frmCategories frmCat = new frmCategories();
                frmCat.ShowDialog();
            }

            if (node.Text == "Taxes")
            {
                frmTaxes frmTax = new frmTaxes();
                frmTax.ShowDialog();
            }

            if (node.Text == "Discounts")
            {
                frmDiscounts frmDisc = new frmDiscounts();
                frmDisc.ShowDialog();
            }

            if (node.Text == "Stock Adjustments")
            {
                frmStockAdjustments frmStkAd = new frmStockAdjustments();
                frmStkAd.ShowDialog();
            }

            if (node.Text == "Stock Transfer")
            {
                frmStockTransfer frmStkTrn = new frmStockTransfer();
                frmStkTrn.ShowDialog();
            }

            if (node.Text == "Disposal Damage")
            {
                frmDisposalDamage frmDisposal = new frmDisposalDamage();
                frmDisposal.ShowDialog();
            }

            if (node.Text == "Purchase Request")
            {
                frmNewPR frmPR = new frmNewPR();
                frmPR.ShowDialog();
            }

            if (node.Text == "Purchase Order")
            {
                frmNewPO frmPO = new frmNewPO();
                frmPO.ShowDialog();
            }


            if (node.Text == "Goods Receive Note")
            {
                frmNewGRN frmGRN = new frmNewGRN();
                frmGRN.ShowDialog();
            }

            if (node.Text == "Purchase Return Note")
            {
                frmPurchaseReturnNote frmPRN = new frmPurchaseReturnNote();
                frmPRN.ShowDialog();
            }

            if (node.Text == "Customer Returns")
            {
                frmCustomerReturns frmCRN = new frmCustomerReturns();
                frmCRN.ShowDialog();
            }

            if (node.Text == "Customer Registation")
            {
                frmCustomerRegistration frmCR = new frmCustomerRegistration();
                frmCR.ShowDialog();
            }

            if (node.Text == "Employee")
            {
                frmEmployee frmEmp = new frmEmployee();
                frmEmp.ShowDialog();
            }

            if (node.Text == "Purchase Order Approval")
            {
                frmPurchaseOrderApproval frmPOA = new frmPurchaseOrderApproval();
                frmPOA.ShowDialog();
            }

            if (node.Text == "GRN Approval")
            {
                frmGRNApproval frmGRNA = new frmGRNApproval();
                frmGRNA.ShowDialog();
            }

            if (node.Text == "PR Approval")
            {
                frmPRApproval frmPRA = new frmPRApproval();
                frmPRA.ShowDialog();
            }

            if (node.Text == "STN Approval")
            {
                frmSTNApproval frmSTNA = new frmSTNApproval();
                frmSTNA.ShowDialog();
            }

            if (node.Text == "New Franchisor")
            {
                frmNewFranchisor frmFran = new frmNewFranchisor();
                frmFran.ShowDialog();
            }

            if (node.Text == "Franchisor Payment")
            {
                frmFranchisorPayment frmFranPay = new frmFranchisorPayment();
                frmFranPay.ShowDialog();
            }

            if (node.Text == "ReciptCancel")
            {
                frmReceiptCancel frmRcptcancle = new frmReceiptCancel();
                frmRcptcancle.ShowDialog();
            }
            
            
            if (node.Text == "ReciptCancel")
            {
                frmReceiptCancel frmRcptcancle = new frmReceiptCancel();
                frmRcptcancle.ShowDialog();
            }

            if (node.Text == "Price List Update")
            {
                frmPriceListUpdate frmPriceUpdate = new frmPriceListUpdate();
                frmPriceUpdate.ShowDialog();
            }
            
            
        }

        private void frm_Main_Load(object sender, EventArgs e)
        {
                        
        }
    }
}
